package com.huixiaodian.baselibrary.view.activity;

import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.LayoutRes;
import androidx.appcompat.app.AppCompatActivity;

import com.huixiaodian.baselibrary.utils.StatusBarUtil;

public abstract class BaseLibraryActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(setContentView());
        initActivityView();
    }

    public abstract @LayoutRes
    int setContentView();

    public void initActivityView() {
        StatusBarUtil.setStatusBarTransparent(this);
        if (!isDarkTitle())
            StatusBarUtil.setStatusBarColorWhite(this);
        else
            StatusBarUtil.setStatusBarColorBlack(this);
    }

    public boolean isDarkTitle(){
        return true;
    };

    public void startActivity(Class<?> clazz) {
        startActivity(new Intent(this, clazz));
    }

    public void startActivityForResult(int requestCode, Class<?> clazz) {
        startActivityForResult(new Intent(this, clazz), requestCode);
    }
}
